package com.bjsxt.chapter2_factory.simpleFactory;

/**
 * @ClassName CarFactory
 * @Description 汽车工厂类
 * @Author 黑马程序员
 * @Date 16:37 2024/6/20
 * @Version 1.0
 **/
public class CarFactory {

    public static Car createCar(String type){
        if ("奥迪".equals(type)){
            return new Audi();
        }else if ("比亚迪".equals(type)){
            return new Byd();
        }else{
            return null;
        }
    }
}
